namespace QMVnSoft.ReportForms
{
    using QMVnSoft;
    using QMVnSoft.Controls;
    using QMVnSoft.DAL;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class FormKCD02NViewer : FormReportViewer
    {
        private IContainer components;
        private LabelControl lblMa_Dt;
        private LabelControl lblMa_Dt_Du;
        private LabelControl lblNgay_Ct1;
        private LabelControl lblNgay_Ct2;
        private LabelControl lblTk;
        private TextSearch txtMa_Dt;
        private TextSearch txtMa_Nh_Dt;
        private TextDate txtNgay_Ct1;
        private TextDate txtNgay_Ct2;
        private TextControl txtTen_Dt;
        private TextControl txtTen_Nh_Dt;
        private TextControl txtTen_Tk;
        private TextControl txtTen_Bp;
        private LabelControl lblMa_Bp;
        private TextSearch txtMa_Bp;
        private TextSearch txtMa_Hd;
        private TextControl txtTen_Hd;
        private LabelControl lblMa_Hd;
        private LabelControl lblNgay_Ky;
        private TextNumeric txtNgay_Ky;
        private TextSearch txtTk;

        public FormKCD02NViewer()
        {
            this.InitializeComponent();
            this.txtTk.Value = "131";
            this.txtNgay_Ky.Value = 30;
            this.txtNgay_Ct1.Value = AppInstance.StartWorkingDate;
            this.txtNgay_Ct2.Value = AppInstance.EndWorkingDate;
        }

        public FormKCD02NViewer(object pd_Ngay_Ct1, object pd_Ngay_Ct2, object ps_No_Co, object ps_Tk, object ps_Ma_Bp, object ps_Ma_Hd, object ps_Ma_Nh_Dt, object ps_Ma_Dt, object pi_VND_NT, object pi_Loai_Tte)
        {
            this.InitializeComponent();
            this.txtNgay_Ct1.Value = pd_Ngay_Ct1;
            this.txtNgay_Ct2.Value = pd_Ngay_Ct2;
            this.txtTk.Value = ps_Tk;
            this.txtMa_Bp.Value = ps_Ma_Bp;
            this.txtMa_Hd.Value = ps_Ma_Hd;
            this.txtMa_Nh_Dt.Value = ps_Ma_Dt;
            this.txtMa_Dt.Value = ps_Ma_Nh_Dt;
            this.txtTen_Tk.Value = this.txtTk.GetFieldData("Ten_Tk");
            this.txtTen_Nh_Dt.Value = this.txtMa_Nh_Dt.GetFieldData("Ten_Dt");
            this.txtTen_Dt.Value = this.txtMa_Dt.GetFieldData("Ten_Nh_Dt");
            this.OnMakeReport();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormKCD02NViewer));
            this.txtTen_Tk = new QMVnSoft.Controls.TextControl();
            this.txtTk = new QMVnSoft.Controls.TextSearch();
            this.lblTk = new QMVnSoft.Controls.LabelControl();
            this.txtTen_Nh_Dt = new QMVnSoft.Controls.TextControl();
            this.txtMa_Nh_Dt = new QMVnSoft.Controls.TextSearch();
            this.lblMa_Dt = new QMVnSoft.Controls.LabelControl();
            this.lblMa_Dt_Du = new QMVnSoft.Controls.LabelControl();
            this.txtMa_Dt = new QMVnSoft.Controls.TextSearch();
            this.txtTen_Dt = new QMVnSoft.Controls.TextControl();
            this.txtNgay_Ct2 = new QMVnSoft.Controls.TextDate();
            this.lblNgay_Ct2 = new QMVnSoft.Controls.LabelControl();
            this.txtNgay_Ct1 = new QMVnSoft.Controls.TextDate();
            this.lblNgay_Ct1 = new QMVnSoft.Controls.LabelControl();
            this.txtTen_Bp = new QMVnSoft.Controls.TextControl();
            this.lblMa_Bp = new QMVnSoft.Controls.LabelControl();
            this.txtMa_Bp = new QMVnSoft.Controls.TextSearch();
            this.txtTen_Hd = new QMVnSoft.Controls.TextControl();
            this.lblMa_Hd = new QMVnSoft.Controls.LabelControl();
            this.txtMa_Hd = new QMVnSoft.Controls.TextSearch();
            this.lblNgay_Ky = new QMVnSoft.Controls.LabelControl();
            this.txtNgay_Ky = new QMVnSoft.Controls.TextNumeric();
            this.rptContainer.Panel1.SuspendLayout();
            this.rptContainer.SuspendLayout();
            this.SuspendLayout();
            // 
            // rptContainer
            // 
            // 
            // rptContainer.Panel1
            // 
            this.rptContainer.Panel1.Controls.Add(this.txtNgay_Ky);
            this.rptContainer.Panel1.Controls.Add(this.lblNgay_Ky);
            this.rptContainer.Panel1.Controls.Add(this.txtTen_Dt);
            this.rptContainer.Panel1.Controls.Add(this.txtMa_Dt);
            this.rptContainer.Panel1.Controls.Add(this.lblMa_Dt);
            this.rptContainer.Panel1.Controls.Add(this.txtMa_Hd);
            this.rptContainer.Panel1.Controls.Add(this.txtTen_Hd);
            this.rptContainer.Panel1.Controls.Add(this.lblMa_Hd);
            this.rptContainer.Panel1.Controls.Add(this.txtTen_Bp);
            this.rptContainer.Panel1.Controls.Add(this.lblMa_Bp);
            this.rptContainer.Panel1.Controls.Add(this.txtMa_Bp);
            this.rptContainer.Panel1.Controls.Add(this.txtNgay_Ct2);
            this.rptContainer.Panel1.Controls.Add(this.lblNgay_Ct2);
            this.rptContainer.Panel1.Controls.Add(this.txtNgay_Ct1);
            this.rptContainer.Panel1.Controls.Add(this.lblNgay_Ct1);
            this.rptContainer.Panel1.Controls.Add(this.txtTen_Nh_Dt);
            this.rptContainer.Panel1.Controls.Add(this.lblMa_Dt_Du);
            this.rptContainer.Panel1.Controls.Add(this.txtMa_Nh_Dt);
            this.rptContainer.Panel1.Controls.Add(this.txtTen_Tk);
            this.rptContainer.Panel1.Controls.Add(this.txtTk);
            this.rptContainer.Panel1.Controls.Add(this.lblTk);
            this.rptContainer.TabIndex = 0;
            // 
            // txtTen_Tk
            // 
            this.txtTen_Tk.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.txtTen_Tk.BackColor = System.Drawing.SystemColors.Control;
            this.txtTen_Tk.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.txtTen_Tk.CheckTextSearched = false;
            this.txtTen_Tk.DisabledForeColor = System.Drawing.Color.Blue;
            this.txtTen_Tk.Enabled = false;
            this.txtTen_Tk.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtTen_Tk.ForeColor = System.Drawing.Color.Blue;
            this.txtTen_Tk.Location = new System.Drawing.Point(214, 6);
            this.txtTen_Tk.Name = "txtTen_Tk";
            this.txtTen_Tk.OldValue = null;
            this.txtTen_Tk.Size = new System.Drawing.Size(258, 13);
            this.txtTen_Tk.TabIndex = 1;
            this.txtTen_Tk.UserTextLength  = QMVnSoft.AppInstance.TextControlLength.None;
            this.txtTen_Tk.UserTrimMode  = QMVnSoft.AppInstance.TextControlTrimMode.Right;
            this.txtTen_Tk.Value = ((object)(resources.GetObject("txtTen_Tk.Value")));
            // 
            // txtTk
            // 
            this.txtTk.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
            this.txtTk.CheckTextSearched = false;
            this.txtTk.DisabledForeColor = System.Drawing.Color.Empty;
            this.txtTk.FieldDisplay = "Ten_Tk";
            this.txtTk.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtTk.FoundIsValid = true;
            this.txtTk.Location = new System.Drawing.Point(108, 3);
            this.txtTk.MaxLength = 32;
            this.txtTk.Name = "txtTk";
            this.txtTk.OldValue = null;
            this.txtTk.Size = new System.Drawing.Size(100, 20);
            this.txtTk.TabIndex = 0;
            this.txtTk.TableName = "DMTK";
            this.txtTk.TextDisplay = this.txtTen_Tk;
            this.txtTk.UserTextLength  = QMVnSoft.AppInstance.TextControlLength.ItemCode;
            this.txtTk.UserTrimMode  = QMVnSoft.AppInstance.TextControlTrimMode.All;
            this.txtTk.Value = ((object)(resources.GetObject("txtTk.Value")));
            // 
            // lblTk
            // 
            this.lblTk.AutoSize = true;
            this.lblTk.Font = new System.Drawing.Font("Arial", 8.25F);
            this.lblTk.Location = new System.Drawing.Point(12, 6);
            this.lblTk.Name = "lblTk";
            this.lblTk.Size = new System.Drawing.Size(53, 14);
            this.lblTk.TabIndex = 87;
            this.lblTk.Text = "Tài khoản";
            // 
            // txtTen_Nh_Dt
            // 
            this.txtTen_Nh_Dt.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.txtTen_Nh_Dt.BackColor = System.Drawing.SystemColors.Control;
            this.txtTen_Nh_Dt.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.txtTen_Nh_Dt.CheckTextSearched = false;
            this.txtTen_Nh_Dt.DisabledForeColor = System.Drawing.Color.Blue;
            this.txtTen_Nh_Dt.Enabled = false;
            this.txtTen_Nh_Dt.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtTen_Nh_Dt.ForeColor = System.Drawing.Color.Blue;
            this.txtTen_Nh_Dt.Location = new System.Drawing.Point(214, 57);
            this.txtTen_Nh_Dt.Name = "txtTen_Nh_Dt";
            this.txtTen_Nh_Dt.OldValue = null;
            this.txtTen_Nh_Dt.Size = new System.Drawing.Size(203, 13);
            this.txtTen_Nh_Dt.TabIndex = 7;
            this.txtTen_Nh_Dt.UserTextLength  = QMVnSoft.AppInstance.TextControlLength.None;
            this.txtTen_Nh_Dt.UserTrimMode  = QMVnSoft.AppInstance.TextControlTrimMode.Right;
            this.txtTen_Nh_Dt.Value = ((object)(resources.GetObject("txtTen_Nh_Dt.Value")));
            // 
            // txtMa_Nh_Dt
            // 
            this.txtMa_Nh_Dt.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
            this.txtMa_Nh_Dt.CheckTextSearched = false;
            this.txtMa_Nh_Dt.DisabledForeColor = System.Drawing.Color.Empty;
            this.txtMa_Nh_Dt.EmptyIsValid = true;
            this.txtMa_Nh_Dt.FieldDisplay = "Ten_Nh_Dt";
            this.txtMa_Nh_Dt.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtMa_Nh_Dt.FoundIsValid = true;
            this.txtMa_Nh_Dt.Location = new System.Drawing.Point(108, 52);
            this.txtMa_Nh_Dt.MaxLength = 32;
            this.txtMa_Nh_Dt.Name = "txtMa_Nh_Dt";
            this.txtMa_Nh_Dt.OldValue = null;
            this.txtMa_Nh_Dt.Size = new System.Drawing.Size(100, 20);
            this.txtMa_Nh_Dt.TabIndex = 6;
            this.txtMa_Nh_Dt.TableName = "DMNHDT";
            this.txtMa_Nh_Dt.TextDisplay = this.txtTen_Nh_Dt;
            this.txtMa_Nh_Dt.UserTextLength  = QMVnSoft.AppInstance.TextControlLength.ItemCode;
            this.txtMa_Nh_Dt.UserTrimMode  = QMVnSoft.AppInstance.TextControlTrimMode.All;
            this.txtMa_Nh_Dt.Value = ((object)(resources.GetObject("txtMa_Nh_Dt.Value")));
            this.txtMa_Nh_Dt.TextChanged += new System.EventHandler(this.txtMa_Dt_TextChanged);
            // 
            // lblMa_Dt
            // 
            this.lblMa_Dt.AutoSize = true;
            this.lblMa_Dt.Font = new System.Drawing.Font("Arial", 8.25F);
            this.lblMa_Dt.Location = new System.Drawing.Point(418, 56);
            this.lblMa_Dt.Name = "lblMa_Dt";
            this.lblMa_Dt.Size = new System.Drawing.Size(55, 14);
            this.lblMa_Dt.TabIndex = 94;
            this.lblMa_Dt.Text = "Đối tượng";
            // 
            // lblMa_Dt_Du
            // 
            this.lblMa_Dt_Du.AutoSize = true;
            this.lblMa_Dt_Du.Font = new System.Drawing.Font("Arial", 8.25F);
            this.lblMa_Dt_Du.Location = new System.Drawing.Point(12, 56);
            this.lblMa_Dt_Du.Name = "lblMa_Dt_Du";
            this.lblMa_Dt_Du.Size = new System.Drawing.Size(83, 14);
            this.lblMa_Dt_Du.TabIndex = 94;
            this.lblMa_Dt_Du.Text = "Nhóm đối tượng";
            // 
            // txtMa_Dt
            // 
            this.txtMa_Dt.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
            this.txtMa_Dt.CheckTextSearched = false;
            this.txtMa_Dt.DisabledForeColor = System.Drawing.Color.Empty;
            this.txtMa_Dt.EmptyIsValid = true;
            this.txtMa_Dt.FieldDisplay = "Ten_Dt";
            this.txtMa_Dt.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtMa_Dt.FoundIsValid = true;
            this.txtMa_Dt.Location = new System.Drawing.Point(472, 53);
            this.txtMa_Dt.MaxLength = 32;
            this.txtMa_Dt.Name = "txtMa_Dt";
            this.txtMa_Dt.OldValue = null;
            this.txtMa_Dt.Size = new System.Drawing.Size(100, 20);
            this.txtMa_Dt.TabIndex = 8;
            this.txtMa_Dt.TableName = "DMDT";
            this.txtMa_Dt.TextDisplay = this.txtTen_Dt;
            this.txtMa_Dt.UserTextLength  = QMVnSoft.AppInstance.TextControlLength.ItemCode;
            this.txtMa_Dt.UserTrimMode  = QMVnSoft.AppInstance.TextControlTrimMode.All;
            this.txtMa_Dt.Value = ((object)(resources.GetObject("txtMa_Dt.Value")));
            // 
            // txtTen_Dt
            // 
            this.txtTen_Dt.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.txtTen_Dt.BackColor = System.Drawing.SystemColors.Control;
            this.txtTen_Dt.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.txtTen_Dt.CheckTextSearched = false;
            this.txtTen_Dt.DisabledForeColor = System.Drawing.Color.Blue;
            this.txtTen_Dt.Enabled = false;
            this.txtTen_Dt.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtTen_Dt.ForeColor = System.Drawing.Color.Blue;
            this.txtTen_Dt.Location = new System.Drawing.Point(575, 58);
            this.txtTen_Dt.Name = "txtTen_Dt";
            this.txtTen_Dt.OldValue = null;
            this.txtTen_Dt.Size = new System.Drawing.Size(207, 13);
            this.txtTen_Dt.TabIndex = 9;
            this.txtTen_Dt.UserTextLength  = QMVnSoft.AppInstance.TextControlLength.None;
            this.txtTen_Dt.UserTrimMode  = QMVnSoft.AppInstance.TextControlTrimMode.Right;
            this.txtTen_Dt.Value = ((object)(resources.GetObject("txtTen_Dt.Value")));
            // 
            // txtNgay_Ct2
            // 
            this.txtNgay_Ct2.DateTimeFormat  = QMVnSoft.Controls.TextDate.DateTimeFormatType.Date;
            this.txtNgay_Ct2.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtNgay_Ct2.InsertKeyMode = System.Windows.Forms.InsertKeyMode.Overwrite;
            this.txtNgay_Ct2.Location = new System.Drawing.Point(275, 77);
            this.txtNgay_Ct2.Mask = "00/00/0000";
            this.txtNgay_Ct2.Name = "txtNgay_Ct2";
            this.txtNgay_Ct2.OldValue = null;
            this.txtNgay_Ct2.Size = new System.Drawing.Size(100, 20);
            this.txtNgay_Ct2.TabIndex = 11;
            this.txtNgay_Ct2.Value = ((object)(resources.GetObject("txtNgay_Ct2.Value")));
            // 
            // lblNgay_Ct2
            // 
            this.lblNgay_Ct2.AutoSize = true;
            this.lblNgay_Ct2.Font = new System.Drawing.Font("Arial", 8.25F);
            this.lblNgay_Ct2.Location = new System.Drawing.Point(215, 80);
            this.lblNgay_Ct2.Name = "lblNgay_Ct2";
            this.lblNgay_Ct2.Size = new System.Drawing.Size(54, 14);
            this.lblNgay_Ct2.TabIndex = 97;
            this.lblNgay_Ct2.Text = "Đến ngày";
            // 
            // txtNgay_Ct1
            // 
            this.txtNgay_Ct1.DateTimeFormat  = QMVnSoft.Controls.TextDate.DateTimeFormatType.Date;
            this.txtNgay_Ct1.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtNgay_Ct1.InsertKeyMode = System.Windows.Forms.InsertKeyMode.Overwrite;
            this.txtNgay_Ct1.Location = new System.Drawing.Point(108, 77);
            this.txtNgay_Ct1.Mask = "00/00/0000";
            this.txtNgay_Ct1.Name = "txtNgay_Ct1";
            this.txtNgay_Ct1.OldValue = null;
            this.txtNgay_Ct1.Size = new System.Drawing.Size(100, 20);
            this.txtNgay_Ct1.TabIndex = 10;
            this.txtNgay_Ct1.Value = ((object)(resources.GetObject("txtNgay_Ct1.Value")));
            // 
            // lblNgay_Ct1
            // 
            this.lblNgay_Ct1.AutoSize = true;
            this.lblNgay_Ct1.Font = new System.Drawing.Font("Arial", 8.25F);
            this.lblNgay_Ct1.Location = new System.Drawing.Point(12, 80);
            this.lblNgay_Ct1.Name = "lblNgay_Ct1";
            this.lblNgay_Ct1.Size = new System.Drawing.Size(47, 14);
            this.lblNgay_Ct1.TabIndex = 98;
            this.lblNgay_Ct1.Text = "Từ ngày";
            // 
            // txtTen_Bp
            // 
            this.txtTen_Bp.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.txtTen_Bp.BackColor = System.Drawing.SystemColors.Control;
            this.txtTen_Bp.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.txtTen_Bp.CheckTextSearched = false;
            this.txtTen_Bp.DisabledForeColor = System.Drawing.Color.Blue;
            this.txtTen_Bp.Enabled = false;
            this.txtTen_Bp.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtTen_Bp.ForeColor = System.Drawing.Color.Blue;
            this.txtTen_Bp.Location = new System.Drawing.Point(214, 30);
            this.txtTen_Bp.Name = "txtTen_Bp";
            this.txtTen_Bp.OldValue = null;
            this.txtTen_Bp.Size = new System.Drawing.Size(203, 13);
            this.txtTen_Bp.TabIndex = 3;
            this.txtTen_Bp.UserTextLength  = QMVnSoft.AppInstance.TextControlLength.None;
            this.txtTen_Bp.UserTrimMode  = QMVnSoft.AppInstance.TextControlTrimMode.Right;
            this.txtTen_Bp.Value = ((object)(resources.GetObject("txtTen_Bp.Value")));
            // 
            // lblMa_Bp
            // 
            this.lblMa_Bp.AutoSize = true;
            this.lblMa_Bp.Font = new System.Drawing.Font("Arial", 8.25F);
            this.lblMa_Bp.Location = new System.Drawing.Point(12, 31);
            this.lblMa_Bp.Name = "lblMa_Bp";
            this.lblMa_Bp.Size = new System.Drawing.Size(47, 14);
            this.lblMa_Bp.TabIndex = 101;
            this.lblMa_Bp.Text = "Bộ phận";
            // 
            // txtMa_Bp
            // 
            this.txtMa_Bp.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
            this.txtMa_Bp.CheckTextSearched = false;
            this.txtMa_Bp.DisabledForeColor = System.Drawing.Color.Empty;
            this.txtMa_Bp.EmptyIsValid = true;
            this.txtMa_Bp.FieldDisplay = "Ten_Bp";
            this.txtMa_Bp.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtMa_Bp.FoundIsValid = true;
            this.txtMa_Bp.Location = new System.Drawing.Point(108, 27);
            this.txtMa_Bp.MaxLength = 32;
            this.txtMa_Bp.Name = "txtMa_Bp";
            this.txtMa_Bp.OldValue = null;
            this.txtMa_Bp.Size = new System.Drawing.Size(100, 20);
            this.txtMa_Bp.TabIndex = 2;
            this.txtMa_Bp.TableName = "DMBP";
            this.txtMa_Bp.TextDisplay = this.txtTen_Bp;
            this.txtMa_Bp.UserTextLength  = QMVnSoft.AppInstance.TextControlLength.ItemCode;
            this.txtMa_Bp.UserTrimMode  = QMVnSoft.AppInstance.TextControlTrimMode.All;
            this.txtMa_Bp.Value = ((object)(resources.GetObject("txtMa_Bp.Value")));
            // 
            // txtTen_Hd
            // 
            this.txtTen_Hd.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.txtTen_Hd.BackColor = System.Drawing.SystemColors.Control;
            this.txtTen_Hd.BorderStyle = System.Windows.Forms.BorderStyle.None;
            this.txtTen_Hd.CheckTextSearched = false;
            this.txtTen_Hd.DisabledForeColor = System.Drawing.Color.Blue;
            this.txtTen_Hd.Enabled = false;
            this.txtTen_Hd.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtTen_Hd.ForeColor = System.Drawing.Color.Blue;
            this.txtTen_Hd.Location = new System.Drawing.Point(575, 32);
            this.txtTen_Hd.Name = "txtTen_Hd";
            this.txtTen_Hd.OldValue = null;
            this.txtTen_Hd.Size = new System.Drawing.Size(207, 13);
            this.txtTen_Hd.TabIndex = 5;
            this.txtTen_Hd.UserTextLength  = QMVnSoft.AppInstance.TextControlLength.None;
            this.txtTen_Hd.UserTrimMode  = QMVnSoft.AppInstance.TextControlTrimMode.Right;
            this.txtTen_Hd.Value = ((object)(resources.GetObject("txtTen_Hd.Value")));
            // 
            // lblMa_Hd
            // 
            this.lblMa_Hd.AutoSize = true;
            this.lblMa_Hd.Font = new System.Drawing.Font("Arial", 8.25F);
            this.lblMa_Hd.Location = new System.Drawing.Point(419, 31);
            this.lblMa_Hd.Name = "lblMa_Hd";
            this.lblMa_Hd.Size = new System.Drawing.Size(54, 14);
            this.lblMa_Hd.TabIndex = 104;
            this.lblMa_Hd.Text = "Hợp đồng";
            // 
            // txtMa_Hd
            // 
            this.txtMa_Hd.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper;
            this.txtMa_Hd.CheckTextSearched = false;
            this.txtMa_Hd.DisabledForeColor = System.Drawing.Color.Empty;
            this.txtMa_Hd.EmptyIsValid = true;
            this.txtMa_Hd.FieldDisplay = "Ten_Hd";
            this.txtMa_Hd.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtMa_Hd.FoundIsValid = true;
            this.txtMa_Hd.Location = new System.Drawing.Point(472, 28);
            this.txtMa_Hd.MaxLength = 32;
            this.txtMa_Hd.Name = "txtMa_Hd";
            this.txtMa_Hd.OldValue = null;
            this.txtMa_Hd.Size = new System.Drawing.Size(100, 20);
            this.txtMa_Hd.TabIndex = 4;
            this.txtMa_Hd.TableName = "DMHD";
            this.txtMa_Hd.TextDisplay = this.txtTen_Hd;
            this.txtMa_Hd.UserTextLength  = QMVnSoft.AppInstance.TextControlLength.ItemCode;
            this.txtMa_Hd.UserTrimMode  = QMVnSoft.AppInstance.TextControlTrimMode.All;
            this.txtMa_Hd.Value = ((object)(resources.GetObject("txtMa_Hd.Value")));
            // 
            // lblNgay_Ky
            // 
            this.lblNgay_Ky.AutoSize = true;
            this.lblNgay_Ky.Font = new System.Drawing.Font("Arial", 8.25F);
            this.lblNgay_Ky.Location = new System.Drawing.Point(419, 80);
            this.lblNgay_Ky.Name = "lblNgay_Ky";
            this.lblNgay_Ky.Size = new System.Drawing.Size(34, 14);
            this.lblNgay_Ky.TabIndex = 105;
            this.lblNgay_Ky.Text = "Số kỳ";
            // 
            // txtNgay_Ky
            // 
            this.txtNgay_Ky.Font = new System.Drawing.Font("Arial", 8.25F);
            this.txtNgay_Ky.Location = new System.Drawing.Point(472, 77);
            this.txtNgay_Ky.Name = "txtNgay_Ky";
            this.txtNgay_Ky.NumericValue = new decimal(new int[] {
            30,
            0,
            0,
            0});
            this.txtNgay_Ky.OldValue = null;
            this.txtNgay_Ky.Size = new System.Drawing.Size(100, 20);
            this.txtNgay_Ky.TabIndex = 12;
            this.txtNgay_Ky.Text = "30,00";
            this.txtNgay_Ky.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
            this.txtNgay_Ky.UserTextNumericFormat  = QMVnSoft.AppInstance.TextNumericFormat.IntNumber;
            this.txtNgay_Ky.Value = new decimal(new int[] {
            30,
            0,
            0,
            0});
            // 
            // FormKCD02NViewer
            // 
            this.ClientSize = new System.Drawing.Size(794, 539);
            this.Name = "FormKCD02NViewer";
            this.rptContainer.Panel1.ResumeLayout(false);
            this.rptContainer.Panel1.PerformLayout();
            this.rptContainer.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        protected override void OnGenerateColumns()
        {
            int LnNgay_Ky = this.txtNgay_Ky == null ? 30 : Int32.Parse(this.txtNgay_Ky.Value.ToString());

            object[][] objArray = new object[12][];
            object[] objArray2 = new object[4];
            objArray2[0] = "Ngay_Ct";
            objArray2[1] = "Ngày chứng từ";
            objArray2[2] = "D";
            objArray[0] = objArray2;
            object[] objArray3 = new object[4];
            objArray3[0] = "So_Ct";
            objArray3[1] = "Số chứng từ";
            objArray3[2] = "C";
            objArray[1] = objArray3;
            object[] objArray4 = new object[4];
            objArray4[0] = "Dien_Giai";
            objArray4[1] = "Diễn giải";
            objArray4[2] = "C";
            objArray[2] = objArray4;
            objArray[3] = new object[] { "Tien0", "Giá trị hóa đơn", "N", AppInstance.TextNumericFormat.LocalAmount };
            objArray[4] = new object[] { "Tien1", "Đã thanh toán", "N", AppInstance.TextNumericFormat.LocalAmount };
            objArray[5] = new object[] { "Tien2", "Còn lại", "N", AppInstance.TextNumericFormat.LocalAmount };
            objArray[6] = new object[] { "Tien3", "Trong hạn", "N", AppInstance.TextNumericFormat.LocalAmount };
            objArray[7] = new object[] { "Tien4", string.Format("1->{0}", LnNgay_Ky), "N", AppInstance.TextNumericFormat.LocalAmount };
            objArray[8] = new object[] { "Tien5", string.Format("{0}->{1}", LnNgay_Ky, 2 * LnNgay_Ky), "N", AppInstance.TextNumericFormat.LocalAmount };
            objArray[9] = new object[] { "Tien6", string.Format("{0}->{1}", 2 * LnNgay_Ky, 3 * LnNgay_Ky), "N", AppInstance.TextNumericFormat.LocalAmount };
            objArray[10] = new object[] { "Tien7", string.Format("> {0}", 3 * LnNgay_Ky), "N", AppInstance.TextNumericFormat.LocalAmount };
            object[] objArray5 = new object[4];
            objArray5[0] = "Ma_Dt";
            objArray5[1] = "Đối tượng";
            objArray5[2] = "C";
            objArray[11] = objArray5;

            base.LocalColNames = objArray;
            base.OnGenerateColumns();
        }

        protected override void OnMakeReport()
        {
            AppInstance.StartWorkingDate = (DateTime) this.txtNgay_Ct1.Value;
            AppInstance.EndWorkingDate = (DateTime) this.txtNgay_Ct2.Value;
            base.LocalTable = new ReportDataAccess().KCD02_Get(AppInstance.Subsidiaries, this.txtNgay_Ct1.Value, this.txtNgay_Ct2.Value, this.txtNgay_Ky.Value, "N", this.txtTk.Value, this.txtMa_Bp.Value, this.txtMa_Hd.Value, this.txtMa_Nh_Dt.Value, this.txtMa_Dt.Value, base.CurrencyIndex, AppInstance.DefLanguage);
            base.OnMakeReport();
        }

        protected override void OnSendParameters()
        {
            base.StimulReport["Ngay"] = "Từ ngày " + string.Format("{0:dd/MM/yyyy}", this.txtNgay_Ct1.Value) + " đến ngày " + string.Format("{0:dd/MM/yyyy}", this.txtNgay_Ct2.Value);
            int LnNgay_Ky = Int32.Parse(this.txtNgay_Ky.Value.ToString());
            base.StimulReport["Ky1"] = string.Format("1->{0}", LnNgay_Ky);
            base.StimulReport["Ky2"] = string.Format("{0}->{1}", LnNgay_Ky, 2 * LnNgay_Ky);
            base.StimulReport["Ky3"] = string.Format("{0}->{1}", 2 * LnNgay_Ky, 3 * LnNgay_Ky);
            base.StimulReport["Ky4"] = string.Format("> {0}", 3 * LnNgay_Ky);

            if (string.IsNullOrEmpty(this.txtTk.Value.ToString()))
            {
                base.StimulReport["TaiKhoan"] = "";
            }
            else
            {
                base.StimulReport["TaiKhoan"] = string.Concat(new object[] { "Tài khoản: ", this.txtTen_Tk.Value, " (", this.txtTk.Value, ")" });
            }
            if (string.IsNullOrEmpty(this.txtMa_Dt.Value.ToString()))
            {
                base.StimulReport["NhomDoiTuong"] = "";
            }
            else
            {
                base.StimulReport["NhomDoiTuong"] = string.Concat(new object[] { "Nhóm đối tượng: ", this.txtTen_Dt.Value, " (", this.txtMa_Dt.Value, ")" });
            }
            if (string.IsNullOrEmpty(this.txtMa_Dt.Value.ToString()))
            {
                base.StimulReport["NhomDoiTuong"] = "";
            }
            else
            {
                base.StimulReport["NhomDoiTuong"] = string.Concat(new object[] { "Nhóm đối tượng: ", this.txtTen_Dt.Value, " (", this.txtMa_Dt.Value, ")" });
            }
            if (string.IsNullOrEmpty(this.txtMa_Nh_Dt.Value.ToString()))
            {
                base.StimulReport["DoiTuong"] = "";
            }
            else
            {
                base.StimulReport["DoiTuong"] = string.Concat(new object[] { "Đối tượng: ", this.txtTen_Nh_Dt.Value, " (", this.txtMa_Nh_Dt.Value, ")" });
            }
        }

        private void txtMa_Dt_TextChanged(object sender, EventArgs e)
        {
        }


        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            if (keyData == Keys.Enter)
            {
                this.OnGenerateColumns();
            }

            return base.ProcessCmdKey(ref msg, keyData);
        }
    }
}

